﻿using Shop.RemoteModel.GoodsSku;
using Shop.RemoteModel.GoodsSku.Model;
using Shop.Service.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;

namespace Shop.Service.RpcEvent
{
    internal class GoodsSkuEvent : IRpcApiService
    {
        private readonly IGoodsSkuService _Service;

        public GoodsSkuEvent (IGoodsSkuService service)
        {
            this._Service = service;
        }
        public GoodsSkuDatum[] GetsGoodsSku (GetsGoodsSku obj)
        {
            return this._Service.Gets(obj.SkuId);
        }
        public PagingResult<GoodsSkuDatum> QueryGoodsSku (QueryGoodsSku obj)
        {
            return this._Service.Query(obj.Query, obj.ToBasicPage());
        }
        public GoodsSkuDto GetGoodsSku (GetGoodsSku obj)
        {
            return this._Service.Get(obj.GoodsId, obj.SpecKey);
        }
        public bool SetGoodsSku (SetGoodsSku obj)
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }
        public long AddGoodsSku (AddGoodsSku obj)
        {
            return this._Service.Add(obj.Datum);
        }
    }
}
